<? if(!defined('IN_ROOT')) exit('Access Denied'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><? $user=$this->user; $setting=$this->setting; ?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Manyou's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=MY_CHARSET?>">
<link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet"/>
<script type="text/javascript">
  	function check_line(){
  	    var tform = document.price_type_form;
  		if(tform.typename.value==""){
  			alert("类型名称不能为空!");
  			tform.typename.focus();
return false;
  		}
  		if (tform.typename.value.length > 6){
alert("价格类型名称不能超过6个字!");
typename.focus();
return false;
}
  		if (tform.price_my.value=="" || tform.price_my.value==0){
  			alert("优惠价不能为空或为零!");
  			tform.price_cncn.focus();
  			return false;
  		}
  		if (tform.descs.value==""){
  			alert("费用说明不能为空!");
  			tform.descs.focus();
  			return false;
  		}
  		if (tform.descs.value.length>2000){
  			alert("费用说明不能超过2000个字!");
  			return false;
  		}
  		tform.submit();
  	}
  	
    function delcfm() {
        if (!confirm("确认要删除该价格类型？")) {
            return false;
        }
    }
    function join_template2(){
  		document.getElementById('descs').value="费用包含：\n费用不包含：\n自费项目说明：";
  	}
</script>

</head>
<body>
<div id="append">
</div>
<div class="container">

        <? if(isset($message)) { $type=isset($type)?$type:'correctmsg';  ?><div class="<?=$type?>"><p><?=$message?></p></div><? } ?><div class="mainbox nomargin">
<div class="hastabmenu">
                <ul class="tabmenu">
                    <li><a href="index.php?admin_line/edit/<?=$lid?>">第一步：编辑描述</a> </li>
                    <li class="tabcurrent"><a href="index.php?admin_line/editprice/<?=$lid?>">第二步：编辑价格</a></li>
                    <li><a href="index.php?admin_line/editday/<?=$lid?>">第三步：编辑行程</a></li>
                    <li><a href="index.php?admin_line/editdesc/<?=$lid?>">第四步：编辑指南</a></li>
                </ul><div class="tabcontentcur"></div>
        </div>
        <div class="form_form">
        
        <? if(!$job) { ?><form action="index.php?admin_line/editpricesave" method="post" name="price_type_form" id="price_type_form" enctype="multipart/form-data">
<h3>添加新的价格类型</h3>
<dl>
<dt>价格类型：<em>*</em></dt><dd><input type="text" class="text text100" name="typename" value="" maxlength="6" />
</dd>
</dl>
<dl><dt>门市价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price" id="price" value="" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl><dt>优惠价：<em>*</em></dt><dd><input type="text" class="text text40" name="price_my" id="price_my" value="" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人(报价需为数字整数，若填写虚假价格或不更新，线路将会被直接删除，联盟将不再另行通知 ！) </span></dd></dl>
<dl><dt>儿童价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price_child" id="price_child" value="" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl>
<dt>费用说明：<em>*</em>
<br><span>1000个字以内</span>
<br><span><a href="#" onclick="join_template2();">使用模板</a></span>
</dt><dd><textarea id="descs" name="descs" class="textarea" cols="" rows=""></textarea></dd>
</dl>
<dl><dt>排序：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="views" value="99" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/> <span>价格类型排序，从小到大排，最大值100</span></dd></dl>
<dl><dt>跳转：<em>&nbsp;</em></dt><dd><input type="radio" value="1" name="tz">继续编辑&nbsp;<input type="radio" value="2" name="tz" checked>编辑行程</dd></dl>
<div class="button">
<ul>
<li><a onclick="check_line();">确定添加</a></li>
</ul>
</div>
<input type="hidden" value="<?=$lid?>" name="lid" />
</form><? } elseif($job =='edit') { ?><form action="index.php?admin_line/editpriceedit" method="post" name="price_type_form" id="price_type_form" enctype="multipart/form-data">
<h3>添加新的价格类型</h3>
<dl>
<dt>价格类型：<em>*</em></dt><dd><input type="text" class="text text100" name="typename" value="<?=$dp['typename']?>" maxlength="6" />
</dd>
</dl>
<dl><dt>门市价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price" id="price" value="<?=$dp['price']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl><dt>优惠价：<em>*</em></dt><dd><input type="text" class="text text40" name="price_my" id="price_my" value="<?=$dp['price_my']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人(报价需为数字整数，若填写虚假价格或不更新，线路将会被直接删除，联盟将不再另行通知 ！) </span></dd></dl>
<dl><dt>儿童价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price_child" id="price_child" value="<?=$dp['price_child']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl>
<dt>费用说明：<em>*</em>
<br><span>1000个字以内</span>
<br><span><a href="#" onclick="join_template2();">使用模板</a></span>
</dt><dd><textarea id="descs" name="descs" class="textarea" cols="" rows=""><?=$dp['descs']?></textarea></dd>
</dl>
<dl><dt>排序：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="views" value="<?=$dp['views']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/> <span>价格类型排序，从小到大排，最大值100</span></dd></dl>
<dl><dt>跳转：<em>&nbsp;</em></dt><dd><input type="radio" value="1" name="tz" checked>继续编辑&nbsp;<input type="radio" value="2" name="tz">编辑行程</dd></dl>
<div class="button">
<ul>
<li><a onclick="check_line();">确定编辑</a></li>
</ul>
</div>
<input type="hidden" value="<?=$lid?>" name="lid" />
<input type="hidden" value="<?=$pid?>" name="pid" />
</form><? } ?></div>

<div id="tab" class="tab_box">
<table width="778" border="0" cellspacing="0" cellpadding="0" class="tab">
  <tr>
    <th width="15%" align="center">价格类型</th>
    <th width="10%" align="center">门市价</th>
    <th width="10%" align="center">优惠价</th>
    <th width="10%" align="center">儿童价</th>
    <th width="15%" align="center">指定日期报价</th>
    <th width="6%" align="center">排序</th>
    <th width="15%" align="center">操作</th>
  </tr>
  
<? if(is_array($list)) { foreach($list as $line) { ?>
    <tr>
    <td align="center"><?=$line['typename']?></td>
    <td align="center"><?=$line['price']?></td>
    <td align="center"><?=$line['price_my']?></td>
    <td align="center"><?=$line['price_child']?></td>
    <td align="center"><a href="#">编辑日期</a></td>
    <td align="center"><?=$line['views']?></td>
    <td align="center"><a href="index.php?admin_line/editprice/<?=$lid?>/edit/<?=$line['id']?>">修改</a>
    <? if($line['isdef']==0) { ?>  <a href="index.php?admin_line/delprice/<?=$lid?>/<?=$line['id']?>" onclick="return delcfm()">删除</a><? } ?>    </td>
  </tr>
  
<? } } ?>
  </table>
</div>


</div>

</body>

</html>
